package ancun;


/**
 * Hello world!
 *
 */
public class App 
{
//    public static void main( String[] args )
//    {
//        PdfPKCS7 sgn;// = new PdfPKCS7(this.signerKeystore.getPrivateKey(),
//                       //             this.signerKeystore.getChain(), null, "SHA1", null, false);
//
////        TSAClientBouncyCastle tsaClient;
////
//        sgn.getEncodedPKCS7(hash, cal, this.tsaClient, ocsp);
//
//        System.out.println( "Hello World!" );
//    }

    public static void main(String[] args) {
            //test
//            String TSA_URL    = "http://tsa.safelayer.com:8093";
//            String TSA_URL    = "http://192.168.0.198:3030";
            String TSA_URL = "http://210.74.41.195/timestamp";          // CFCA
//            String TSA_URL =  "http://edaotech.asuscomm.com:58181/api/rfc3161";

            String TSA_ACCNT  = "";
            String TSA_PASSW  = "";
            String IN_FILE = "D:\\ancunTest2.pdf"; //"D:\\投资合作协议_4.pdf";
            String OUT_FILE = "D:\\test_signed.pdf";

            String CERT_PATH  = "D:\\zl_111111.pfx";

            String CERT_PASSW = "111111";
            ancun.PDFSigner signer = new ancun.PDFSigner(TSA_URL,TSA_ACCNT,TSA_PASSW,CERT_PATH,CERT_PASSW);
            try {
                signer.signPDF(IN_FILE,OUT_FILE);
            } catch (Exception e) {
                e.printStackTrace();
            }
    }
}
